      subroutine namlen(fname,nlen)
      character*80 fname
      integer nlen
      i=1
C     get the length of fname and store it in nlen
100   if (fname(i:i).eq.' ') then
          nlen=i-1
          goto 200
      else
          i=i+1
          goto 100
      endif
200   continue
      return
      end
